import request from '@/utils/request'

// 获取销售前几的商品
export function getSkuTop(topValue, start, end) {
  return request.get(`/order-service/report/skuTop/${topValue}/${start}/${end}`)
}

// 获取销售额统计
export function getAmountCollect(collectType, start, end) {
  return request.get(`/order-service/report/amountCollect/${collectType}/${start}/${end}`)
}

// 获取订单总数
export function getOrderCount(params) {
  return request.get('/order-service/report/orderCount', { params })
}

// 获取工单状态统计
export function getTaskReportInfo(start, end) {
  return request.get(`/task-service/task/taskReportInfo/${start}/${end}`)
}

// 获取一定时间范围内的收入
export function getOrderAmount(params) {
  return request.get('/order-service/report/orderAmount', { params })
}

// 获取地区汇总销售额数据
export const getRegionCollect = (start, end) => {
  return request.get(`/order-service/report/regionCollect/${start}/${end}`)
}

// 商品类型搜索
export const getGoodsType = params => request.get('/vm-service/skuClass/search', { params })

// 新增商品类型
export const addGoodsType = data => request.post('/vm-service/skuClass', data)

// 修改商品类型
export const modifyGoodsType = data => request.put(`/vm-service/skuClass/${data.classId}`, data)

// 删除商品类型
export const delGoodsType = classId => request.delete(`/vm-service/skuClass/${classId}`)
